package com.javacore.day13.thread.example5;

public class MoneyTransfer implements Runnable {

	private BankAccount from, to;
	private float amount;

	public MoneyTransfer(BankAccount from, BankAccount to, float amount) {
		this.from = from;
		this.to = to;
		this.amount = amount;
	}

	public void run() {
		System.out.println("START transfer money FROM: " + from.getName() + " TO: " + to.getName());
		from.transfer(amount, to);
		System.out.println("DONE transfer money!");
	}
}